package Task6_3;

import java.io.*;

/**
 * @author Administrator
 */
public class Task6_3 {
    public static void main(String[] args) throws IOException {
//        OutputStream out=new FileOutputStream("a.txt");
        BufferedOutputStream bos =new BufferedOutputStream(new FileOutputStream("a.txt"));

        String s="Hello Java";
        bos.write(s.getBytes());
        bos.close();

        BufferedInputStream bis=new BufferedInputStream(new FileInputStream("a.txt"));
        byte[] bys=new byte[1024];
        int len=0;
        while ((len=bis.read(bys))!=-1){
            System.out.println(new String(bys,0,len));
        }
    }
}
